import React from "react";
import { Form, Col, Row, Button } from "antd";
import "./index.css";

function FormEdit(props){
    const{onFinish,initialValues,name,getFields,resetFields,saveBack,form}=props;
    return(
        <>
     
     <Form
        form={form}
        name={name}
        className="ant-advanced-search-form"
        onFinish={onFinish}
        initialValues={initialValues}
      >
        <Row gutter={24}>{getFields}</Row>
        <Row>
          <Col span={24} style={{ textAlign: "right" }}>

          <Button 
            style={{paddingLeft:50,paddingRight:50}}
            onClick={()=>saveBack()}
            >
              保存并返回
            </Button>

            <Button
              type="primary" htmlType="submit" 
              style={{ margin: "0 8px",paddingLeft:50,paddingRight:50}}
            >
              保存
            </Button>
          
            <Button
                style={{ margin: "0 8px",paddingLeft:50,paddingRight:50}}
                onClick={()=>resetFields()}
                >
              取消
            </Button>
         
          
          </Col>
        </Row>
      </Form>
        </>
    )
}

export default FormEdit;